package AB;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Zuoye4 {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();
        SimpleDateFormat simp = new SimpleDateFormat("yyyy-MM-dd EEEE");
        c.set(2022, 0, 1);
        for (int i = 0, count = 1; i < 365; i++) {
            if (c.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
                String s = simp.format(c.getTime());
                System.out.println("今年的第" + (count++) + "个星期天是  " + s);
            }
            c.add(Calendar.DAY_OF_YEAR, 1);
        }
    }
}
